/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ssi.mrms.service.Impl;

import com.ssi.mrms.dao.ConciergeDepositDao;
import com.ssi.mrms.model.DataTableModel;
import com.ssi.mrms.model.RMcdhdrModel;
import com.ssi.mrms.model.RMwnltModel;
import com.ssi.mrms.service.ConciergeDepositService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author jirapatjantsakool
 */
@Service("ConciergeDepositService")
public class ConciergeDepositServiceImpl implements ConciergeDepositService {

    @Autowired ConciergeDepositDao dao;
    
    @Override
    public List<RMcdhdrModel> getAllConciergeAndDeposit() {
          return dao.findAll();
    }

    @Override
    public RMcdhdrModel getConciergeAndDepositById(Integer cdhid) {
        return dao.findById(cdhid);
    }

    @Override
    @Transactional
    public void save(RMcdhdrModel model) throws Exception {
        dao.create(model);
    }

    @Override
    @Transactional
    public boolean update(RMcdhdrModel model) {
        return dao.update(model);
    }

    @Override
    @Transactional
    public boolean delete(RMcdhdrModel model) {
        return dao.delete(model);
    }

    @Override
    public DataTableModel<RMcdhdrModel> getConciergeDepositDataTable(RMcdhdrModel model, int iDisplayStart, int iDisplayLength) {
        return dao.findDataTable(model, iDisplayStart, iDisplayLength);
    }
    
}
